<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
echo "<h2>Слайдер</h2>";
$this->table->set_heading('id', 'Товар', 'Текст акции', 'Дата окончания', 'Действия');
$tmpl = array('table_open' => '<table border="0" cellpadding="0" cellspacing="0" class="admin_table">');
$this->table->set_template($tmpl);

$class = 'slider';
if ($this->users_rights_model->check_rights($class, 'block', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'unblock', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'edit', true)) $canedit = 1;
if ($this->users_rights_model->check_rights($class, 'delete', true)) $candelete = 1;
if ($this->users_rights_model->check_rights($class, 'add', true)) $canadd = 1;

$d = 0;
foreach ($pages as $page) {
$item = $this->db->select()->from('catalog_items')->where('item_id', $page['slide_item'])->get()->row_array();
	$d++;
	$this->table->add_row(
			$page['slide_id'],
			"<a href='/admin/catalog/edit_item/".$item['item_id']."/' target='_blank'>".$item['item_title']."</a>",
			$page['slide_text'],
			showmedate($page['slide_date']),
			//array('data' => "<input class='ordering' type='text' tabindex='".$d."' value='".$page['slide_order']."' name='order[".$page['slide_id']."]' />", 'style' => 'text-align: center;'),
			showmeactions(
					$class,
					$page['slide_id'],
					$page['slide_status'],
					0, $candelete, 0,
					$from
				)
		);
}

//echo "<form action='/admin/".$class."/order/' method='post'>";
echo $this->table->generate();
//echo "</form>";
echo "<div class='cc'></div>";
echo $form;
?>
